import {searchFormMetas} from "@/metas/ComponentMetas";
import MetaUtils from "@/utils/MetaUtils";
import Utils from "@/utils/basic.utils";

const basicLabel = '基础配置';

const TextTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const SelectTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const RadioTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const RateTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const DateTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const SwitchTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const CheckboxTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const NumberTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const SliderTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const CascadeTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const StreeTabMetas = {
    basic: {label: basicLabel, metas: [...searchFormMetas]},
}

const SearchFormTabMetas = {
    TextTabMetas, NumberTabMetas, SelectTabMetas
    , RadioTabMetas, CascadeTabMetas, CheckboxTabMetas, StreeTabMetas
    , SliderTabMetas, SwitchTabMetas , DateTabMetas, RateTabMetas
}

function getSearchFormTabMetas(type) {
    type = Utils.firstUpperCase(type) + 'TabMetas';
    let searchFormTabMeta = SearchFormTabMetas[type];
    if(null == searchFormTabMeta) {
        return console.warn(`搜索栏不支持此类型[${type}]`);
    }

    return MetaUtils.cloneTabMetas(searchFormTabMeta);
}

export {getSearchFormTabMetas}
